import Vue from 'vue'
import App from './App.vue'
import router from './router'
/*导入全局样式表*/
import './assets/style/global.css'

// import './plugin/element'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI);

//导入并注册vue-table-with-tree-gird
import TreeTable from 'vue-table-with-tree-grid'
Vue.component('tree-table', TreeTable)

//引入iconfont
import './assets/iconfont/iconfont.css'

//引入axios
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
//axios请求拦截
axios.interceptors.request.use(config => {
  //为请求头对象，添加token验证的Authorization字段
  config.headers.Authorization = window.sessionStorage.getItem('token')
  console.log(config)
  return config
})
Vue.prototype.$http = axios

Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
